﻿<UserControl x:Class="ModernUILogViewer.Pages.TestFile"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             xmlns:content="clr-namespace:ModernUILogViewer.Content"
             xmlns:conv="clr-namespace:ModernUILogViewer.Converters"
             xmlns:view="clr-namespace:ModernUILogViewer.View"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             DataContext="{Binding Source={StaticResource mainVM}, Path=TestFileResultVM}"
             >

    <UserControl.Resources>
        <conv:NullToBooleanConverter x:Key="nulltobooleanconverter" />
        <conv:FilenameConverter x:Key="fileconverter" />
    </UserControl.Resources>

    <Grid >
        <!--<ScrollViewer>-->
        <DockPanel>
            <Grid DockPanel.Dock="Top">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel Orientation="Horizontal" >
                    <mui:ModernButton 
                        ToolTip="Open file"
                        Command="{Binding OpenTestFile}" 
                        EllipseDiameter="24" IconWidth="16" IconHeight="16"                           
                        VerticalAlignment="Top"
                        IconData="F1 M 19,50L 28,34L 63,34L 54,50L 19,50 Z M 19,28.0001L 35,28C 36,25 37.4999,24.0001 37.4999,24.0001L 48.75,24C 49.3023,24 50,24.6977 50,25.25L 50,28L 53.9999,28.0001L 53.9999,32L 27,32L 19,46.4L 19,28.0001 Z"              
                    />
                    <mui:ModernButton 
                        x:Name="reloadButton"
                        ToolTip="Process content"
                        Command="{Binding ProcessContent}" 
                        Margin="{StaticResource DefaultLeftMargin}"
                        EllipseDiameter="24" IconWidth="16" IconHeight="16"                           
                        VerticalAlignment="Top"
                        IconData="F1 M 38,20.5833C 42.9908,20.5833 47.4912,22.6825 50.6667,26.046L 50.6667,17.4167L 55.4166,22.1667L 55.4167,34.8333L 42.75,34.8333L 38,30.0833L 46.8512,30.0833C 44.6768,27.6539 41.517,26.125 38,26.125C 31.9785,26.125 27.0037,30.6068 26.2296,36.4167L 20.6543,36.4167C 21.4543,27.5397 28.9148,20.5833 38,20.5833 Z M 38,49.875C 44.0215,49.875 48.9963,45.3932 49.7703,39.5833L 55.3457,39.5833C 54.5457,48.4603 47.0852,55.4167 38,55.4167C 33.0092,55.4167 28.5088,53.3175 25.3333,49.954L 25.3333,58.5833L 20.5833,53.8333L 20.5833,41.1667L 33.25,41.1667L 38,45.9167L 29.1487,45.9167C 31.3231,48.3461 34.483,49.875 38,49.875 Z "
                        IsEnabled="{Binding InputRegex, Converter={StaticResource nulltobooleanconverter}, ConverterParameter='false'}"
                    />
                </StackPanel>
                <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
                    <mui:ModernButton 
                        ToolTip="Help online"
                        Command="{x:Static view:ViewCommands.OpenUrl}" 
                        CommandParameter="{StaticResource regexdocurl}"
                        EllipseDiameter="24" IconWidth="16" IconHeight="16"                           
                        VerticalAlignment="Top"
                        Margin="{StaticResource DefaultRightMargin}"
                        IconData="{StaticResource helpPathData}"              
                    />
                </StackPanel>
            </Grid>
            <Grid Style="{StaticResource ContentRoot}" DockPanel.Dock="Bottom">
                <content:ContentTestFile />
            </Grid>
        </DockPanel>
        <!--</ScrollViewer>-->
    </Grid>
</UserControl>
